/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package estg.dae.projecto.bank.controllers;

import estg.dae.projecto.bank.impl.ElectronicOperationTO;
import estg.dae.projecto.bank.model.Account;
import estg.dae.projecto.bank.model.AccountMovement;
import estg.dae.projecto.bank.model.Client;
import estg.dae.projecto.bank.model.ElectronicTransfer;
import java.util.Collection;
import javax.ejb.Local;

/**
 *
 * @author Marco
 */
@Local
public interface BankSessionLocal {
    public boolean existsAccountByNib(String nib);

    public boolean existsAccountByNumber(long number);

    public Account getAccountByNib(String nib);

    public Account getAccountByNumber(long number);

    public Collection<AccountMovement> getAccountMovements(Account account, int movs);

    public AccountMovement doWithdraw(String originAccountRef, double value) throws Exception;
    public AccountMovement doTransfer(String originAccountRef, String destinAccountRef, double value) throws Exception;
    public AccountMovement doMoneyDeposit(String destinAccountRef, double value) throws Exception;
    public AccountMovement doCheckDeposit(String originAccountRef, String destinAccountRef, double value) throws Exception;

    public Account getAccountById(long accountId);

    public Client getClientById(int clientId);

    public Account createAccount(Client client, int agencyCode, double overBalance);

    public void updateAccount(Account account);

    public void createClient(Client client, int agencyCode);

    public void updateClient(Client client);

    public Collection<Client> getAllClients();

    public Collection<ElectronicTransfer> getOfflineTransfers();

    public void sendOfflineTransfer(ElectronicOperationTO electronicOperationTO);
}
